ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

《鳥哥 Linux 私房菜:基礎篇》Chapter 05 - Linux 的檔案權限與目錄配置

《鳥哥 Linux 私房菜:基礎篇》Chapter 05 - Linux 的檔案權限與目錄配置

給每個Python專案一個乾淨獨立的環境

給每個Python專案一個乾淨獨立的環境

響應式RWD實作練習

響應式RWD實作練習


Comments